export const handleGoodsItem = (obj, personNum) => {
	const ylEnterprise = JSON.parse(uni.getStorageSync('ylEnterprise') || '{}')
	return {
		commodityUrl: obj.commodityUrls[0].url,
		commodityName: obj.name,
		salesPrice: obj.groupPrice,
		enterpriseName: ylEnterprise.enterpriseName,
		groupPersonNum: obj.groupPersonNum,
		personNum: personNum,
		uniqueId: obj.uniqueId
	}
}
// 团购
export const handleGoodsCampaignItem = (obj, personNum, activityCode) => {
	const ylEnterprise = JSON.parse(uni.getStorageSync('ylEnterprise') || '{}')
	return {
		images: obj.productImage,
		name: obj.productName,
		salesPrice: obj.groupPrice, // 优惠后价格
		enterpriseName: ylEnterprise.enterpriseName,
		groupPersonNum: obj.groupPersonNum,
		personNum: personNum,
		code: obj.productCode,
		stock: obj.stock,
		spread: obj.spread, // 优惠价格
		isGroupbuy: true,
		activityCode: activityCode
	}
}

// 团购1
export const handleGoodsGroupItem = (obj, personNum, activityCode) => {
	const ylEnterprise = JSON.parse(uni.getStorageSync('ylEnterprise') || '{}')
	return {
		images: obj.images,
		name: obj.name,
		minPrice: obj.minPrice,
		groupPersonNum: obj.groupBuyNum, // 已有几人拼团
		maxGroupBuyNum: obj.maxGroupBuyNum, // 每人最大团购数量 
		personNum: obj.surplus_num, //几人成团
		code: obj.code,
		stock: obj.stock,
		id: obj.id,
		// isGroupbuy: true,
	}
}